package com.locationbasedagent;

import android.os.Parcel;
import android.os.Parcelable;

import com.locationbasedagent.shared.HouseListingProxy;

public class LocalHouseListing implements HouseListingProxy, Parcelable{

	private Long id;
	private String listingName;
	private String listingAddress;
	private String listingCity;
	private String listingZip;
	private String agentID;
	private String agentNumber;
	private String latitude;
	private String longitude;
	private String listingPrice;
	private String photoURL1;
	private String photoURL2;
	private String photoURL3;
	private String photoURL4;
	private String photoURL5;
	private String video;
	
	public LocalHouseListing(Parcel in) {
		id = in.readLong();
		listingName = in.readString();
		listingAddress = in.readString();
		listingCity = in.readString();
		listingZip = in.readString();
		agentID = in.readString();
		agentNumber = in.readString();
		latitude = in.readString();
		longitude = in.readString();
		listingPrice = in.readString();
		photoURL1 = in.readString();
		photoURL2 = in.readString();
		photoURL3 = in.readString();
		photoURL4 = in.readString();
		photoURL5 = in.readString();
		video = in.readString();
	}
	
	public LocalHouseListing(HouseListingProxy proxy) {
		id = proxy.getId();
		listingName = proxy.getListingName();
		listingAddress = proxy.getListingAddress();
		listingCity = proxy.getListingCity();
		listingZip = proxy.getListingZip();
		agentID = proxy.getSellingAgentID();
		agentNumber = proxy.getSellingAgentPhoneNumber();
		latitude = proxy.getLatitude();
		longitude = proxy.getLongitude();
		listingPrice = proxy.getListingPrice();
		photoURL1 = proxy.getPhotoURL1();
		photoURL2 = proxy.getPhotoURL2();
		photoURL3 = proxy.getPhotoURL3();
		photoURL4 = proxy.getPhotoURL4();
		photoURL5 = proxy.getPhotoURL5();
		video = proxy.getVideoURL();
	}
	
	@Override
	public Long getId() {
		return id;
	}

	@Override
	public String getListingName() {
		return listingName;
	}

	@Override
	public void setListingName(String listingname) {
		listingName = listingname;
		
	}

	@Override
	public String getListingAddress() {
		return listingAddress;
	}

	@Override
	public void setListingAddress(String listingaddress) {
		listingAddress = listingaddress;
		
	}

	@Override
	public String getListingCity() {
		return listingCity;
	}

	@Override
	public void setListingCity(String listingcity) {
		listingCity = listingcity;
		
	}

	@Override
	public String getListingZip() {
		return listingZip;
	}

	@Override
	public void setListingZip(String listingzip) {
		listingZip = listingzip;
		
	}

	@Override
	public String getSellingAgentID() {
		return agentID;
	}

	@Override
	public void setSellingAgentID(String sellingAgentID) {
		agentID = sellingAgentID;
		
	}

	@Override
	public String getSellingAgentPhoneNumber() {
		return agentNumber;
	}

	@Override
	public void setSellingAgentPhoneNumber(String sellingAgentNumber) {
		agentNumber = sellingAgentNumber;
		
	}

	@Override
	public String getLatitude() {
		return latitude;
	}

	@Override
	public void setLatitude(String value) {
		latitude = value;
		
	}

	@Override
	public String getLongitude() {
		return longitude;
	}

	@Override
	public void setLongitude(String value) {
		longitude = value;
		
	}

	@Override
	public String getListingPrice() {
		return listingPrice;
	}

	@Override
	public void setListingPrice(String price) {
		listingPrice = price;
		
	}
	
	@Override
	public String getPhotoURL1() {
		return photoURL1;
	}
	
	@Override
	public void setPhotoURL1(String photoURL) {
		photoURL1 = photoURL;
	}
	
	@Override
	public String getPhotoURL2() {
		return photoURL2;
	}
	
	@Override
	public void setPhotoURL2(String photoURL) {
		photoURL2 = photoURL;
	}
	
	@Override
	public String getPhotoURL3() {
		return photoURL3;
	}
	
	@Override
	public void setPhotoURL3(String photoURL) {
		photoURL3 = photoURL;
	}
	
	@Override
	public String getPhotoURL4() {
		return photoURL4;
	}
	
	@Override
	public void setPhotoURL4(String photoURL) {
		photoURL4 = photoURL;
	}
	
	@Override
	public String getPhotoURL5() {
		return photoURL5;
	}
	
	@Override
	public void setPhotoURL5(String photoURL) {
		photoURL5 = photoURL;
	}
	
	@Override
	public String getVideoURL() {
		return video;
	}
	
	@Override
	public void setVideoURL(String videoURL) {
		video = videoURL;
	}

	@Override
	public int describeContents() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeLong(id);
		dest.writeString(listingName);
		dest.writeString(listingAddress);
		dest.writeString(listingCity);
		dest.writeString(listingZip);
		dest.writeString(agentID);
		dest.writeString(agentNumber);
		dest.writeString(latitude);
		dest.writeString(longitude);
		dest.writeString(listingPrice);
		dest.writeString(photoURL1);
		dest.writeString(photoURL2);
		dest.writeString(photoURL3);
		dest.writeString(photoURL4);
		dest.writeString(photoURL5);
		dest.writeString(video);
		
	}
	
	public static final Parcelable.Creator<LocalHouseListing> CREATOR = new Parcelable.Creator<LocalHouseListing>() {
		
		public LocalHouseListing createFromParcel(Parcel source) {
	            return new LocalHouseListing(source);
	      }
	      public LocalHouseListing[] newArray(int size) {
	            return new LocalHouseListing[size];
	      }
	      
	      
	};

}
